package com.hgw.Demo06_MementoPattern.upgradeExamples;

import java.util.ArrayList;

/**
 * Data time:2021/12/18 21:07
 * StudentID:2019112118
 * Author:hgw
 * Description: 象棋棋子备忘录管理类，充当负责人
 */
public class MementoCaretaker {
    // 定义一个集合来存储多个备忘录
    private ArrayList<ChessmanMemento> mementoList = new ArrayList<ChessmanMemento>();

    public ChessmanMemento getMemento(int i) {
        return (ChessmanMemento)mementoList.get(i);
    }

   public void setMemento(ChessmanMemento memento) {
        mementoList.add(memento);
   }
}
